#pragma config(Hubs,  S1, HTServo,  HTServo,  none,     none)
#pragma config(Sensor, S1,     ,                    sensorI2CMuxController)
#pragma config(Servo,  srvo_S1_C1_1,    servo1,               tServoStandard)
#pragma config(Servo,  srvo_S1_C1_2,    servo2,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_3,    servo3,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_6,    servo6,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_1,    servo7,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_2,    servo8,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_3,    servo9,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_4,    servo10,              tServoNone)
#pragma config(Servo,  srvo_S1_C2_5,    servo11,              tServoNone)
#pragma config(Servo,  srvo_S1_C2_6,    servo12,              tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

//TJoystick joystick;

task main()
{
  int LOCKED = -180 ;
  int UNLOCKED = 180 ;
  int LOCKposition = UNLOCKED ;

  while (true)
  {
    getJoystickSettings(joystick);
   // motor[motorD] = joystick.joy1_y1;
   // motor[motorE] = -joystick.joy1_y2;


     if     (joystick.joy1_Buttons == 0x40)
      {
        LOCKposition = LOCKED ;
      }

     if     (joystick.joy1_Buttons == 0x10)
      {
        LOCKposition = UNLOCKED;
      }

    servo [servo1] = LOCKposition ;

}

}
